<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2024/8/15
  Time: 19:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>修改图书信息</title>
    <%
        String base = request.getContextPath()+"/";
        String url = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+base;
    %>
    <base href="<%=url%>">
    <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("[type='button']").click(function () {
                var bookId = $("[name='bookId']").val();
                var BookName=$("[name='BookName']").val();
                var BookAuthor = $("[name='BookAuthor']").val();
                var val = $("[name='BookPublish']").val();
                var val1 = $("[name='BookPage']").val();
                var val2 = $("[name='BookPrice']").val();
                var val3 = $("[name='CreateDate']").val();
                alert(bookId);
                $.get("book/upBook",{"bookId":bookId,"BookName":BookName,"BookAuthor":BookAuthor,"val":val,"val1":val1,"val2":val2,"val3":val3},function (str) {
                    JSON.stringify(str);
                    if(str){
                        alert("修改成功");
                    }else{
                        alert("修改失败");
                    }


                });

            });

        });
    </script>
</head>
<body>
<a href="index.jsp">返回</a>
<h1>更改图书</h1>
图书编号<input type="text" name="bookId"/><br/>
书名：<input type="text" name="BookName"><br>
作者：<input type="text" name="BookAuthor"><br>
出版社：<input type="text" name="BookPublish"><br>
页数：<input type="text" name="BookPage"><br>
价格：<input type="text" name="BookPrice"><br>
时间：<input type="text" name="CreateDate"><br>
<input type="button" value="更改">
<input type="hidden" name="hitxt" value="<%=request.getParameter("bookId")%>"/>
</body>
</html>
